<script src="/javascripts/tiny_mce/tiny_mce.js" type="text/javascript"></script>
<script src="/javascripts/mce_editor.js" type="text/javascript"></script>
<div class='form'>
  <% form_for @abstract_product,:html=>{:multipart=>true} do |f| %>
    <%= f.error_messages %>

    <div>
      <table class="admin">
        <thead>
          <tr>
            <th colspan="2">选择子商品</th>
          </tr>
        </thead>
        <tbody>
          <%for @product in @products%>
            <tr>
              <td><%=@product.name%></td>
              <td> <%=check_box("product[]","id",{:checked=>@abstract_product.products.include?(@product)},@product.id)%></td>
            </tr>
          <%end%>
        </tbody>
      </table>

    </div>
    <p>
      <label for="abstract_product_image─url">上传图片</label>
      <%= file_column_field "abstract_product", "image_url" %>
    </p>

    <p>
      <label for="abstract_product_description">描述</label>
      <%= f.text_area :description,:class =>"mce-editor" %>
    </p>

    <input name="brand_id" id="brand_id" type="hidden" value="<%=params[:brand_id]%>"></input>
    <input name="category_id" id="category_id" type="hidden" value="<%=params[:category_id]%>"></input>
    <p>
      <%= f.submit button_name,:class=>'submit' %>
    </p>
  <% end %>
</div>